<?php defined('IN_IA') or exit('Access Denied');?><!DOCTYPE html>
<html>
	<head>

		<meta charset="utf-8" />
		<title>鉴宝</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes"/>
		<meta name="format-detection" content="telephone=no"  />
		<meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
		<link rel="stylesheet" href="../addons/ewei_shopping/images/css/style.css" />
		<script type="text/javascript" src="../addons/ewei_shopping/images/js/jquery-1.7.1.min.js" ></script>
		<script type="text/javascript" src="../addons/ewei_shopping/images/js/jquery.event.drag-1.5.min.js" ></script>
		<script type="text/javascript" src="../addons/ewei_shopping/images/js/jquery.touchSlider.js" ></script>
		<script type="text/javascript" src="../addons/ewei_shopping/images/js/all.js" ></script>
<!--         <script language="javascript" src="../addons/ewei_shopping/images/touchslider.min.js"></script>
        <script language="javascript" src="../addons/ewei_shopping/images/swipe.js"></script> -->
<script type="text/javascript">
$(document).ready(function(){

	$(".main_visual").hover(function(){
		$("#btn_prev,#btn_next").fadeIn()
	},function(){
		$("#btn_prev,#btn_next").fadeOut()
	});
	
	$dragBln = false;
	
	$(".main_image").touchSlider({
		flexible : true,
		speed : 200,
		btn_prev : $("#btn_prev"),
		btn_next : $("#btn_next"),
		paging : $(".flicking_con a"),
		counter : function (e){
			$(".flicking_con a").removeClass("on").eq(e.current-1).addClass("on");
		}
	});
	
	$(".main_image").bind("mousedown", function() {
		$dragBln = false;
	});
	
	$(".main_image").bind("dragstart", function() {
		$dragBln = true;
	});
	
	$(".main_image a").click(function(){
		if($dragBln) {
			return false;
		}
	});
	
	timer = setInterval(function(){
		$("#btn_next").click();
	}, 5000);
	
	$(".main_visual").hover(function(){
		clearInterval(timer);
	},function(){
		timer = setInterval(function(){
			$("#btn_next").click();
		},5000);
	});
	
	$(".main_image").bind("touchstart",function(){
		clearInterval(timer);
	}).bind("touchend", function(){
		timer = setInterval(function(){
			$("#btn_next").click();
		}, 5000);
	});
	
});
</script>
	</head>
	<body>
		<div class="wapper">
			<header>
				<div class="goback"><a href=""><img src="../addons/ewei_shopping/images/img/back.png" /> <span>返回</span></a></div>
				<div class="midtit">微信在线鉴宝</div>
				<div class="morshar"><a href="">...</a></div>
			</header>
			<section class="banner">
				<div class="main_visual">
					<div class="flicking_con">
						<a href="#">1</a>
						<a href="#">2</a>
						<a href="#">3</a>
						<a href="#">4</a>
						<a href="#">5</a>
					</div>
					<div class="main_image">
                        <ul>
                            <?php  if(is_array($advs)) { foreach($advs as $key => $adv) { ?>
                            <li>
                                <a href="<?php  if(empty($adv['link'])) { ?>#<?php  } else { ?><?php  echo $adv['link'];?><?php  } ?>">
                                    <img src="<?php  echo tomedia($adv['thumb']);?>" title="<?php  echo $adv['advname'];?>"/>
                                </a>
                                <span class="title"><?php  echo $adv['advname'];?></span>
                            </li>
                            <?php  } } ?>
                        </ul>
						<a href="javascript:;" id="btn_prev"></a>
						<a href="javascript:;" id="btn_next"></a>
					</div>
				</div>
			</section>
			<section class="kidsgood">
				<div class="kidcon">
					<ul>
						<li><a href="<?php  echo $this->createMobileUrl('jianbaolist',array('category'=>3))?>"><img src="../addons/ewei_shopping/images/img/kd1.png" /><a/></li>
						<li><a href="<?php  echo $this->createMobileUrl('jianbaolist',array('category'=>4))?>"><img src="../addons/ewei_shopping/images/img/kd2.png" /><a/></li>
						<li><a href="<?php  echo $this->createMobileUrl('jianbaolist',array('category'=>5))?>"><img src="../addons/ewei_shopping/images/img/kd3.png" /><a/></li>
						<li><a href="<?php  echo $this->createMobileUrl('jianbaolist',array('category'=>6))?>"><img src="../addons/ewei_shopping/images/img/kd4.png" /><a/></li>
						<li><a href="<?php  echo $this->createMobileUrl('jianbaolist',array('category'=>7))?>"><img src="../addons/ewei_shopping/images/img/kd5.png" /><a/></li>	
						
					</ul>
				</div>
			</section>
            <a href="<?php  echo $this->createMobileUrl('member')?>">会员中心</a><br/>
            <a href="<?php  echo $this->createMobileUrl('newslist')?>">新闻资讯</a>
			<section class="piclist">
				<div class="piclistcon">
					<ul id="zailist">
                        <?php  if(is_array($orders)) { foreach($orders as $key => $ord) { ?>
						<li><a href="<?php  echo $this->createMobileUrl('expert')?>">
							<div class="piczs">
								<p class="topimg"><img src="../addons/ewei_shopping/images/img/pic1.jpg" /></p>
								<span class="zw"><img <?php  if($ord['test']){ ?>src="../addons/ewei_shopping/images/img/zhen.png"<?php  }else{ ?>src="../addons/ewei_shopping/images/img/jia.png"<?php  } ?>/></span>
								<div class="botboder">
									<p>
										<span class="hytou"><img src="../addons/ewei_shopping/images/img/toux.png" /></span>
										<span class="hyname">会员昵称</span>
									</p>
									<p class="time">
										<span>07-11 </span>
										<span><img src="../addons/ewei_shopping/images/img/view.png" /> 10</span>
									</p>
								</div>
							</div>	
						</a></li>
                        <?php  } } ?>
					</ul>
                    <div id="pager" style="font-size:10px;font-color:#ddd;text-align:center;height:20px" ></div>
				</div>
			</section>
			<footer>
				<ul>
					<li><a href="">
						<p class="icoimg"><img src="../addons/ewei_shopping/images/img/home.png"  /></p>
						<p>首页</p>
					</a>
					</li>
					<li><a href="">
						<p class="icoimg"><img src="../addons/ewei_shopping/images/img/zj.png" /></p>
						<p>专家</p>
						</a>
					</li>
					<li><a href="">
						<p class="icoimg"><img src="../addons/ewei_shopping/images/img/yyclass.png" /></p>
						<p>语音课堂</p>
						</a>
					</li>
				</ul>
			</footer>
		</div>
<input type="hidden" pindex="2" id="pager"/>
<script>
function loadPage(cur_page,page_size) {
	var pindex = cur_page;
  
    $('#pager').html('正在加载数据...');
	$.post(location.href, {'page' : pindex}, function(data){
    console.log(data);
    
        var jsondata = jQuery.parseJSON(data); 
        var li_clone =  "";
 //图片调用：<img src="'+item.newthumb+'" />
        $.each(jsondata, function(i, item) {
            
            li_clone += "<li>"
            li_clone += ' <a href="">'
            li_clone += '<div class="piczs">'
            li_clone += '<p class="topimg"><img src="../addons/ewei_shopping/images/img/pic1.jpg" /></p>'
            li_clone += '<span class="zw"><img src="../addons/ewei_shopping/images/img/zhen.png" /></span>'
            li_clone += '<div class="botboder">'
            li_clone += '<p>'
            li_clone += '<span class="hytou"><img src="../addons/ewei_shopping/images/img/toux.png" /></span>'
            li_clone += '<span class="hyname">会员昵称</span>'
            li_clone += '</p>'
            li_clone += '<p class="time">'
            li_clone += '<span>07-11 </span>'		
            li_clone += '<span><img src="../addons/ewei_shopping/images/img/view.png" /> 10</span>'		
            li_clone += '</p>'		
            li_clone += '</div>'	
            li_clone += '</div>'	
            li_clone += '</a>'		
            li_clone += "</li>"
        });
		$('#zailist').append(li_clone);
        $('#pager').html("");
	});
}

$(function(){
    var cur_page = 1;
    var page_size = 5;
    $(window).scroll(function(){
        var scrollTop = $(window).scrollTop();
        var owinH=$(window).height();
        var odocH = $(document).height();
        if(scrollTop + owinH+30 >= odocH){
            //console.log("这里是滚到底部的处理分页，这里需要你请求后台的数据！！")
            ++cur_page;
            loadPage( cur_page,page_size);
        }
         
    });
})
</script>
	</body>
</html>
